﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.IO;

namespace Puzzles_IQ
{
    public static class ExtensionMethods
    {
        public static string FolderName(this String path)
        {
            return path.Substring(path.LastIndexOf('\\') + 1);
        }

        public static string FileName(this String path)
        {
            return path.Substring(path.LastIndexOf('\\') + 1);
        }

        public static string AddApplicationPath(this String localpath)
        {
            string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string path = Path.Combine(dir, localpath);
            return path;
        }
    }
}
